home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
fortran
/
libry51.zip
/
LIBRY6A.DOC
< prev
next >
Wrap
Text File
|
1989-11-10
|
2KB
|
68 lines
.de
.pa
EXAMPLE PROGRAM USING PLOT ROUTINES
$STORAGE:2
PROGRAM PLOT
C
C this program illustrates how to use the plot subroutines
C
IMPLICIT INTEGER*2(I-N),REAL*4(A-H,O-Z)
DIMENSION IXBOX(4),IYBOX(4)
DATA LU,IOPT/8086,0/
DATA IXBOX/245,245,315,315/
DATA IYBOX/ 45,115,115, 45/
C
C begin plot
C
CALL START(LU,IOPT)
C
C put a large label at the top of the CRT
C 12345678901234567
CALL SYMBS(24,180,16,1.,0.,0.,0,'THIS IS THE TITLE',17,LU)
C
C put a smaller label at the bottom of the CRT
C 123456789012345678901234
CALL SYMBS(12,6,12,1.,0.,0.,0,'this could be the legend',24,LU)
C
C draw a 3-leaf rose in the middle of the CRT in 3 colors
C
IX2=160
IY2=120
DO 100 IDEGREES=1,180
RADIANS=FLOAT(IDEGREES)/57.2957795
R=80.*SIN(3.*RADIANS)
X=R*COS(RADIANS)
Y=R*SIN(RADIANS)
IX1=IX2
IY1=IY2
IX2=160+NINT(X)
IY2=120+NINT(Y)
ICOLOR=1
IF(IDEGREES.GT. 60) ICOLOR=2
IF(IDEGREES.GT.120) ICOLOR=3
CALL COLOR(ICOLOR,LU,0)
100 CALL LINE0(IX1,IY1,IX2,IY2,2,LU)
C
C draw a circle with a box around it
C
CALL COLOR(1,LU,0)
CALL CIRCL(40,80,30,0,360,LU)
C
CALL COLOR(2,LU,0)
CALL BOX(5,45,75,115,LU)
C
C draw a box, outline it, and fill it in solid
C
CALL COLOR(3,LU,0)
CALL PATRN(IXBOX,IYBOX,4,0.,-1,2,LU)
C
C terminate plot
C
CALL QUITS(LU,IOPT)
C
STOP
END
.de